package com.quickboot.common.controller;

import com.alibaba.fastjson.JSON;
import com.quickboot.common.entity.Result;
import com.quickboot.common.utils.SaTokenUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Tellsea
 * @date 2022/12/30
 */
@RestController
@RequestMapping("/common/test")
public class TestController {

    @GetMapping
    public Result test() {
        System.out.println(SaTokenUtils.getUserId());
        System.out.println(JSON.toJSONString(SaTokenUtils.getRoleList()));
        System.out.println(JSON.toJSONString(SaTokenUtils.getRoles()));
        System.out.println(JSON.toJSONString(SaTokenUtils.getPermissionList()));
        System.out.println(JSON.toJSONString(SaTokenUtils.getPermissions()));
        return Result.ok("success");
    }
}
